<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>SSL证书管理系统 - 一键部署</title>
    <style>
      * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
      }

      body {
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
        line-height: 1.6;
        color: #333;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        min-height: 100vh;
        padding: 20px;
      }

      .container {
        max-width: 1200px;
        margin: 0 auto;
        background: white;
        border-radius: 12px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
        overflow: hidden;
      }

      .header {
        background: linear-gradient(135deg, #2c3e50, #3498db);
        color: white;
        padding: 30px;
        text-align: center;
      }

      .header h1 {
        font-size: 2.5em;
        margin-bottom: 10px;
      }

      .header p {
        font-size: 1.2em;
        opacity: 0.9;
      }

      .content {
        padding: 40px;
      }

      .deploy-methods {
        margin-bottom: 40px;
      }

      .method-card {
        border: 2px solid #e1e8ed;
        border-radius: 8px;
        padding: 25px;
        transition: all 0.3s ease;
      }

      .method-card:hover {
        border-color: #3498db;
        box-shadow: 0 5px 15px rgba(52, 152, 219, 0.1);
      }

      .method-card h3 {
        color: #2c3e50;
        margin-bottom: 15px;
        font-size: 1.4em;
      }

      .method-card p {
        color: #666;
        margin-bottom: 20px;
      }

      .cmd-container {
        display: flex;
        align-items: center;
        margin-bottom: 15px;
        gap: 10px;
      }

      .cmd-container code {
        flex: 1;
        min-width: 0;
        background: #f8f9fa;
        border: 1px solid #e9ecef;
        border-radius: 6px;
        padding: 15px;
        font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
        font-size: 14px;
        color: #2c3e50;
        word-break: keep-all;
        white-space: pre-wrap;
        overflow-wrap: break-word;
        line-height: 1.5;
      }

      .copy-btn {
        flex-shrink: 0;
        background: #3498db;
        color: white;
        border: none;
        border-radius: 4px;
        padding: 5px 10px;
        font-size: 12px;
        cursor: pointer;
        transition: background 0.3s ease;
        height: fit-content;
      }

      .copy-btn:hover {
        background: #2980b9;
      }

      .copy-btn.copied {
        background: #27ae60;
      }

      .section {
        margin-bottom: 35px;
      }

      .section h2 {
        color: #2c3e50;
        margin-bottom: 20px;
        padding-bottom: 10px;
      }

      .requirements {
        background: #fff3cd;
        border: 1px solid #ffeaa7;
        border-radius: 6px;
        padding: 20px;
        margin-bottom: 25px;
      }

      .requirements h4 {
        color: #856404;
        margin-bottom: 10px;
      }

      .requirements ul {
        color: #856404;
        margin-left: 20px;
      }

      .post-deploy {
        background: #d1ecf1;
        border: 1px solid #bee5eb;
        border-radius: 6px;
        padding: 20px;
      }

      .post-deploy h4 {
        color: #0c5460;
        margin-bottom: 10px;
      }

      .baota-deploy {
        background: #d1f1de;
        border: 1px solid #beebd1;
        border-radius: 6px;
        padding: 20px;
        margin-bottom: 20px;
      }

      .baota-deploy h4 {
        color: #0c5460;
        margin-bottom: 10px;
      }

      .mb0 {
        margin-bottom: 0;
      }

      .bt-img {
        max-width: 100%;
        height: auto;
        border-radius: 4px;
      }

      .note {
        background: #e2e3e5;
        border-left: 4px solid #6c757d;
        padding: 15px;
        margin: 20px 0;
        border-radius: 0 4px 4px 0;
      }

      .note p {
        margin: 0;
        color: #495057;
      }

      @media (max-width: 768px) {
        .header h1 {
          font-size: 2em;
        }

        .content {
          padding: 20px;
        }
      }
    </style>
  </head>
  <body>
    <div class="container">
      <div class="header">
        <h1>🔐 SSL证书销售管理系统</h1>
        <p>一键部署，多级代理</p>
      </div>

      <div class="content">
        <div class="section">
          <h2>🚀 一键部署命令</h2>
          <div class="requirements">
            <h4>📋 系统需求：</h4>
            <ul>
              <li><strong>操作系统：</strong>Ubuntu 18.04+ / CentOS 7+ / Debian 9+</li>
              <li><strong>权限：</strong>root用户或sudo权限</li>
              <li><strong>网络：</strong>服务器能访问外网</li>
              <li><strong>内存：</strong>建议2GB以上</li>
              <li><strong>存储：</strong>建议20GB以上可用空间</li>
            </ul>
          </div>
        </div>

        <div class="section">
          <div class="deploy-methods">
            <div class="method-card">
              <h3>📜 脚本部署</h3>
              <div class="requirements">
                <h4>⚠️ 运行前请确保：</h4>
                <ul>
                  <li><strong>PHP：</strong>8.3+</li>
                  <li><strong>nginx：</strong>1.8+</li>
                  <li><strong>mysql：</strong>5.7+</li>
                  <li><strong>redis：</strong>6.0+</li>
                </ul>
              </div>
              <p>
                脚本需要在站点目录执行，以同步站点目录的权限。<br />先进入站点目录，cd /www/site
                (替换为实际站点目录)，再复制下面脚本执行
              </p>
              <span>自动选择仓库</span>
              <div class="cmd-container">
                <!-- prettier-ignore -->
                <code>wget -qO- https://gitee.com/zhuxbo/cert-manager-deploy/raw/main/deploy.sh | sudo bash</code>
                <button
                  class="copy-btn"
                  onclick="copyToClipboard(this, 'wget -qO- https://gitee.com/zhuxbo/cert-manager-deploy/raw/main/deploy.sh | sudo bash')"
                >
                  复制
                </button>
              </div>
              <span>使用gitee仓库</span>
              <div class="cmd-container">
                <!-- prettier-ignore -->
                <code>wget -qO- https://gitee.com/zhuxbo/cert-manager-deploy/raw/main/deploy.sh | sudo bash -s -- gitee</code>
                <button
                  class="copy-btn"
                  onclick="copyToClipboard(this, 'wget -qO- https://gitee.com/zhuxbo/cert-manager-deploy/raw/main/deploy.sh | sudo bash -s -- gitee')"
                >
                  复制
                </button>
              </div>
              <span>使用github仓库</span>
              <div class="cmd-container">
                <!-- prettier-ignore -->
                <code>wget -qO- https://gitee.com/zhuxbo/cert-manager-deploy/raw/main/deploy.sh | sudo bash -s -- github</code>
                <button
                  class="copy-btn"
                  onclick="copyToClipboard(this, 'wget -qO- https://gitee.com/zhuxbo/cert-manager-deploy/raw/main/deploy.sh | sudo bash -s -- github')"
                >
                  复制
                </button>
              </div>
              <div class="post-deploy">
                <h4>🎉 脚本部署成功后：</h4>
                <p>1. 访问安装向导完成初始化</p>
                <div class="cmd-container">
                  <code>http://你的域名/install</code>
                  <button class="copy-btn" onclick="copyToClipboard(this, 'http://你的域名/install')">复制</button>
                </div>
                <div class="requirements">
                  <h4>默认管理员账号：</h4>
                  <ul>
                    <li>用户名：admin</li>
                    <li>密码：123456</li>
                    <li>⚠️ 请立即修改默认密码</li>
                  </ul>
                </div>
                <p>2. 设置定时任务和队列，在站点目录执行</p>
                <div class="cmd-container">
                  <code>sudo ./cmd-deploy-scripts/setup-queue.sh</code>
                  <button class="copy-btn" onclick="copyToClipboard(this, 'sudo ./cmd-deploy-scripts/setup-queue.sh')">
                    复制
                  </button>
                </div>
              </div>
            </div>
          </div>
          <div class="deploy-methods">
            <div class="method-card">
              <h3>🐳 Docker部署</h3>
              <div class="requirements">
                <h4>⚠️ 运行前请确保：</h4>
                <ul>
                  <li><strong>端口：</strong>80、443 端口未被占用</li>
                </ul>
              </div>
              <div class="cmd-container">
                <!-- prettier-ignore -->
                <code>wget -qO- https://gitee.com/zhuxbo/cert-manager-deploy/raw/main/deploy.sh | sudo bash -s -- docker</code>
                <button
                  class="copy-btn"
                  onclick="copyToClipboard(this, 'wget -qO- https://gitee.com/zhuxbo/cert-manager-deploy/raw/main/deploy.sh | sudo bash -s -- docker')"
                >
                  复制
                </button>
              </div>
              <span>使用gitee仓库</span>
              <div class="cmd-container">
                <!-- prettier-ignore -->
                <code>wget -qO- https://gitee.com/zhuxbo/cert-manager-deploy/raw/main/deploy.sh | sudo bash -s -- docker gitee</code>
                <button
                  class="copy-btn"
                  onclick="copyToClipboard(this, 'wget -qO- https://gitee.com/zhuxbo/cert-manager-deploy/raw/main/deploy.sh | sudo bash -s -- docker gitee')"
                >
                  复制
                </button>
              </div>
              <span>使用github仓库</span>
              <div class="cmd-container">
                <!-- prettier-ignore -->
                <code>wget -qO- https://gitee.com/zhuxbo/cert-manager-deploy/raw/main/deploy.sh | sudo bash -s -- docker github</code>
                <button
                  class="copy-btn"
                  onclick="copyToClipboard(this, 'wget -qO- https://gitee.com/zhuxbo/cert-manager-deploy/raw/main/deploy.sh | sudo bash -s -- docker github')"
                >
                  复制
                </button>
              </div>
              <div class="post-deploy">
                <h4>🎉 Docker部署成功后：</h4>
                <p>可直接访问系统（无需 install）：</p>
                <div class="cmd-container">
                  <code>http://你的域名/admin</code>
                  <button class="copy-btn" onclick="copyToClipboard(this, 'http://你的域名/admin')">复制</button>
                </div>
                <div class="requirements">
                  <h4>默认管理员账号：</h4>
                  <ul>
                    <li>用户名：admin</li>
                    <li>密码：123456</li>
                    <li>⚠️ 请立即修改默认密码</li>
                  </ul>
                </div>
              </div>
            </div>
          </div>
        </div>

        <div class="section">
          <div class="deploy-methods">
            <div class="method-card">
              <h3>宝塔面板配置（脚本部署）</h3>

              <div class="baota-deploy">
                <h4>1. 设置命令PHP版本</h4>
                <img src="img/bt-1.png" alt="宝塔PHP版本设置" class="bt-img" />
              </div>

              <div class="baota-deploy">
                <h4>2. 安装必需的PHP扩展</h4>
                <img src="img/bt-2.png" alt="宝塔PHP扩展安装" class="bt-img" />
              </div>

              <div class="baota-deploy">
                <h4>3. 进入站点目录下载脚本并运行</h4>
                <img src="img/bt-3.png" alt="宝塔站点目录" class="bt-img" />
              </div>

              <div class="baota-deploy">
                <h4>4. 在宝塔面板中配置定时任务</h4>
                <img src="img/bt-4.png" alt="宝塔定时任务配置" class="bt-img" />
                <div class="cmd-container">
                  <!-- prettier-ignore -->
                  <code>php /www/wwwroot/{your_site}/artisan schedule:run</code>
                  <button
                    class="copy-btn"
                    onclick="copyToClipboard(this, 'php /www/wwwroot/{your_site}/artisan schedule:run')"
                  >
                    复制
                  </button>
                </div>
              </div>

              <div class="baota-deploy mb0">
                <h4>5. 在宝塔面板中配置队列进程</h4>
                <p>安装插件：软件商店 → 系统工具 → Supervisor管理器</p>
                <img src="img/bt-5.png" alt="宝塔队列进程配置" class="bt-img" />
                <div class="cmd-container">
                  <!-- prettier-ignore -->
                  <code>php artisan queue:work --queue Task --tries 3 --delay 5 --max-jobs 1000 --max-time 3600 --memory 128 --timeout 60 --sleep 3</code>
                  <button
                    class="copy-btn"
                    onclick="copyToClipboard(this, 'php artisan queue:work --queue Task --tries 3 --delay 5 --max-jobs 1000 --max-time 3600 --memory 128 --timeout 60 --sleep 3')"
                  >
                    复制
                  </button>
                </div>
              </div>
            </div>
          </div>
        </div>

        <div class="note">
          <p>
            <strong>💡 提示：</strong
            >脚本会自动检测系统环境并安装所需依赖。Docker部署会自动处理队列和定时任务，无需手动配置。
          </p>
        </div>

        <div class="note">
          <p><strong>🛠️ 遇到问题？</strong>请查看部署日志或访问项目文档获取详细帮助。</p>
        </div>
      </div>
    </div>

    <script>
      function copyToClipboard(button, text) {
        // 创建临时文本区域
        const textarea = document.createElement("textarea");
        textarea.value = text;
        document.body.appendChild(textarea);

        // 选择并复制文本
        textarea.select();
        document.execCommand("copy");

        // 移除临时元素
        document.body.removeChild(textarea);

        // 更新按钮状态
        const originalText = button.textContent;
        button.textContent = "已复制";
        button.classList.add("copied");

        // 2秒后恢复原状
        setTimeout(() => {
          button.textContent = originalText;
          button.classList.remove("copied");
        }, 2000);
      }
    </script>
  </body>
</html>
